package com.alipay.app.groupmeal.standard.ui.b;

import android.content.Context;
import android.view.Display;
import android.view.KeyEvent;

import com.alipay.app.groupmeal.standard.R;
import com.alipay.app.groupmeal.standard.base.BasePresentation;
import com.alipay.app.groupmeal.standard.ui.b.function.amount.BScreenAwaitPay;
import com.alipay.app.groupmeal.standard.ui.c.abcp.CPayingAbcpActivity2;

public class PayingPre extends BasePresentation {

    private BScreenAwaitPay await_pay;

    private CPayingAbcpActivity2 cPayingAbcpActivity2;

    public void setcPayingAbcpActivity2(CPayingAbcpActivity2 cPayingAbcpActivity2) {
        this.cPayingAbcpActivity2 = cPayingAbcpActivity2;
    }

    public PayingPre(Context outerContext, Display display) {
        super(outerContext, display);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.view_presentation_paying;
    }

    @Override
    protected void initView() {
        await_pay = findViewById(R.id.await_pay);
    }

    @Override
    protected void initData() {
    }

    public void showPaying(String amount) {
        await_pay.setAmount(amount);
        await_pay.setTitle("支付中...");
        await_pay.show();
    }

    public void showWaitPay(String amount) {
        await_pay.setAmount(amount);
        await_pay.setTitle("等待支付");
        await_pay.show();
    }

    public void showQrCheck() {
        await_pay.setTitle("正在查单中。。。。。");
    }
    @Override
    public boolean onKeyEventBack(KeyEvent event) {
        if (cPayingAbcpActivity2 != null)
            cPayingAbcpActivity2.onKeyEventBack(event);
        return super.onKeyEventBack(event);
    }
}
